<#assign ctx="${request.contextPath}" /> <#assign
shiro=JspTaglibs["/WEB-INF/taglib/shiro.tld"] />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>审批列表页面</title>
<link href="${ctx}/static/css/style.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/static/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/static/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/select-ui.min.js"></script>
<script type="text/javascript" src="${ctx}/static/editor/kindeditor.js"></script>

<script type="text/javascript">
	KE.show({
		id : 'content7',
		cssPath : './index.css'
	});
</script>
</head>

<body>
<!-- 点击分配弹框 -->
<style>
	.modal{width:100%;height:100%;position:fixed;background:rgba(0,0,0,0.3);z-index:98;}
	.pop{width:500px;height:380px;position:fixed;left:50%;top:50%;margin-left:-250px;margin-top:-190px;background:#fff;z-index:99;border-radius:20px;}
	.pop .head{height:40px;background:#377ebc;overflow:hidden;padding:0 20px;}
	.pop .head .pl{float:left;font-size:16px;color:#fff;line-height:40px;}
	.pop .head .close{float:right;font-size:30px;color:#fff;line-height:40px;}
	.pop .dc{height:285px;overflow:hidden;margin-top:15px;}
	.pop .dc .label{float:left;font-size:14px;color:#333;width:150px;text-align:center;line-height:32px;}
	.pop .dc select{float:left;width:300px;border:1px solid #999;opacity:1;height:32px;line-height:32px;}
	.pop .db {height:40px;background:#eee;overflow:hidden;}
	.pop .db .close{float:right;width:60px;height:25px;margin-top:8px;margin-right:20px;font-size:14px;color:#333;line-height:24px;border-radius:5px;background:#aaa;}
	.pop .db .confirm{float:right;width:60px;height:25px;margin-top:8px;margin-right:20px;font-size:14px;color:#fff;line-height:24px;border-radius:5px;background:#377ebc;}
</style>
<div class="modal-box" style="display:none;">
	<div class="modal"></div>
	<div class="pop">
		<div class="head">
			<p class="pl">分配客户</p>
			<a class="close">×</a>
		</div>
		<div class="dc">
			<span class="label">选择审核员：</span>
			<select name="selectAuditor">
				<option value="" default="checked">选择审核员</option>
				<#list auditorList  as list>
					<option value="${list.id}">${list.realName}</option>
				</#list>
			</select> 
		</div>
		<div class="db">
			<button class="confirm" type="submit">确定</button>
			<button class="close">取消</button>
		</div>
	</div>
</div>

<form action="${ctx}/audit/auditor" method="post" id="form">
	<div class="formbody">
		<div id="usual1" class="usual">
			<div style="margin-top: 15px" class="myof">
				<div class="mylf">
					<label>进件日期：</label>
										<input class="scinput scinput1" type="date" id="auditTime1" name="auditTime1" style="width:120px" value="${auditTime1}"/>
					&nbsp;至&nbsp;&nbsp;<input class="scinput scinput1" type="date" id="auditTime2" name="auditTime2" style="width:120px" value="${auditTime2}"/>&nbsp;&nbsp;
					
					 
					<label>姓名:</label>&nbsp;&nbsp;<input name="name" id="name" value="${name}" type="text" class="scinput" />&nbsp;&nbsp;   
				    <label>手机号:</label>&nbsp;&nbsp;<input name="phone" id="phone" value="${phone}" type="text" class="scinput" />  &nbsp;&nbsp;
				    <select  name="realName" id="realName"  value="${realName}"  style=" opacity: 10;  filter: alpha(opacity=100);border: 1px solid #ccc;width: 70px;height: 34px;">
						<option value="" >审核员</option>
						<#list auditorList  as list>
							<#if realName=list.realName>
								<option  value="${list.realName}" selected="selected">${list.realName}</option>
							</#if>
							<option  value="${list.realName}" >${list.realName}</option>
						</#list>
					</select> 
					&nbsp;&nbsp;
				    <select  name="status" id="status"    style=" opacity: 10;  filter: alpha(opacity=100);border: 1px solid #ccc;width: 85px;height: 34px;">
						
						<option value=""  default="selected" >全部状态</option>
						<#if status = 3>
							<option value="3" selected="selected" >驳回</option>
						</#if>
						<#if status = 4>
							<option value="4" selected="selected" >已拒绝</option>
						</#if>
						<#if status = 2>
							<option value="2" selected="selected" >已通过</option>
						</#if>
						<#if status = 7>
							<option value="7" selected="selected" >待审核</option>
						</#if>
						<#if status = 1>
							<option value="1" selected="selected" >专员审核中</option>
						</#if>
						<#if status =8>
							<option value="8" selected="selected" >经理审核中</option>
						</#if>
						<option value="3" >驳回</option>
						<option value="4" >已拒绝</option>
						<option value="2" >已通过</option>
						<option value="7" >待审核</option>	
						<option value="1" >专员审核中</option>	
						<option value="8" >经理审核中</option>	
							
	 				</select> 
				</div>
				<label class="add_css"  ><span><input name="" type="submit" class="btn" value="" id="ser"></span><label for="ser">搜索</label></label> 
			</div>
			<!-- <input type="button" class="btn js_fp" id="dis" value="分配"/> -->
			<div id="tab" class="tabson" >
				<table class="tablelist">
					<thead >
						<tr >
							<th><input type="checkbox"/></th>
							<th>进件ID</th>
							<th>客户姓名</th>
							<th>手机号</th>
							<th>身份证号</th>
							<th>审核员</th>
							<th>进件日期</th>
							<th>当前状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<#list page.rows  as list>
						<tr>
							<td><input type="checkbox" name="checkDis" value="${list.id}"/></td>
							<td>${list.apply_main_id?c}</td>
							<td>${list.name}</td>
							<td>${list.phone}</td>
							<td>${list.id_no}</td>
							<td>${list.real_name}</td>
							<td>${list.audit_time}</td>
							<#if list.status==null>
					        	<td>未提交 </td>
					        </#if>
					        <#if list.status==1>
					        	<td>审核中</td>
					        </#if>
					        
					        <#if list.status==2>
					        	<td>通过</td>
					        </#if>
					        
					        <#if list.status==3>
					        	<td>驳回</td>
					        </#if>	
					        
					        <#if list.status==4>
					        	<td>拒绝</td>
					        </#if>	
					        
					        <#if list.status==5>
					        	<td>完成还款 </td>
					        </#if>
					        <#if list.status==6>
					        	<td>已提交待分配 </td>
					        </#if>
					        <#if list.status==7>
					        	<td>已经分配 </td>
					        </#if>
							<td>
								<a href="${ctx}/audit/detail?applyId=${list.apply_main_id?c}" class="tablelink">详情</a>
					        </td>
						</tr>
						</#list>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<#include "/page.html"/>
</form>
<div class="tip" style="display: none;">
   		<div class="tiptop"><span>返回信息</span><a class="close"></a></div>
      	<div class="tipinfo">
	        <div class="tipright">
		        <p class="errormMssage"></p>
	        </div>
	    </div>
        <div class="tipbtn">
	        <input name="ok" type="button" class="sure close" value="确定"/>&nbsp;
	        <input name="no" type="button" class="cancel close" value="取消"/>
       	</div>
 </div>
<script type="text/javascript">
	$("#usual1 ul").idTabs();
</script>

<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
</script>

<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
</script>

<script type="text/javascript">
$(document).ready(function(){
		$("#btn").click(function(){
			document.getElementById("textDate").value();
		});
		
		//关闭返回信息弹框
		$('.close').click(function(){
			$('.tip').hide();
		});
		
		//全选跟取消全选
		$('.tablelist thead input[type="checkbox"]').click(function(){
			var checks=$(this).closest('thead').siblings('tbody').find('input[type="checkbox"]');
			if($(this).is(":checked")){
				checks.attr("checked","checked");
			}else{
				checks.removeAttr("checked");
			}
		});
		var num=0;
		 $('.tablelist tbody input[type="checkbox"]').click(function(){
			var val;
			if($(this).is(":checked")){
				num++;
			}else{
				num--;
			}
			if(num == $(this).closest('tbody').find('tr').length){
				$(this).closest('table').find('thead input[type="checkbox"]').attr("checked","checked");
			}else{
				$(this).closest('table').find('thead input[type="checkbox"]').removeAttr("checked");
			}
		}); 
		 
		//弹出，关闭分配弹框
		$('.js_fp').click(function(){
			var ids = "";
			var tempIds = "";
			ids = $("input:checkbox[name=checkDis]:checked").each(function(i){
				if(i==0){
					tempIds = $(this).val();
				}else{
					tempIds+=(","+$(this).val());
				}
			});
			if(null == tempIds || ""==tempIds){
				alert("请至少选择一条记录！")
			}else{
			    $("#checkApplyId").val(tempIds);
				$('.modal-box').show();
				
			}
		});
		$('.close').click(function(){
			$('.modal-box').hide();
		});
	})
	
	$(".confirm").click(function(){
		var checkApplyIds = $("#checkApplyId").val();
		var userId = $("select[name='selectAuditor']").val()
		if(userId == null || userId==""){
			alert("请选择审核员！");
		}else{
			userId = $("select[name='selectAuditor']").val();
			$.post("/audit/distribute", 
					{ userId: userId, applyIds: checkApplyIds },
				     function(data){
						if(data.status==200){
							$(".errormMssage").html(data.msg);
							 $(".tip").fadeIn(200);
						}else{
							$(".errormMssage").html(data.msg);
							 $(".tip").fadeIn(200);
						}
				     }
			);
			
		}
	});
</script>

<script type="text/javascript">
	$("#usual1 ul").idTabs();
	$('.tablelist tbody tr:odd').addClass('odd');
	
</script>

<script type="text/javascript">
	
	$('.form').click(function(){
		var auditTime1 = $("#auditTime1").val().replace(/\s/g,"");
    	var auditTime2 = $("#auditTime2").val().replace(/\s/g,"");
    	var updateTime1 = $("#updateTime1").val().replace(/\s/g,"");
    	var updateTime2 = $("#updateTime2").val().replace(/\s/g,"");
    	var realName = $("#realName").val().replace(/\s/g,"");
    	var phone = $("#phone").val().replace(/\s/g,"");
    	var idNo = $("#idNo").val().replace(/\s/g,"");
    	
    	$("#form").submit();
	})	
</script>
</body>
</html>
